<title>gro file format</title>
<LINK rel=stylesheet href="style.css" type="text/css">
<BODY text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#650065" alink="#FF0000">
<h2>gro file format</h2>
<CENTER><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 COLS=2 WIDTH="98%">
<TR>
<TD><font size=-1><A HREF="../online.html">Main Table of Contents</A></font></TD>
<TD ALIGN=RIGHT><B>VERSION 4.0</B></TR>
<TR><TD><font size=-1><A HREF="http://www.gromacs.org">GROMACS homepage</A></font></TD>
<TD ALIGN=RIGHT><B>Sun 18 Jan 2009</B></TR></TABLE></CENTER><HR>

<p>Files with the gro file extension contain a molecular structure in
Gromos87 format. gro files can be used as trajectory by simply
concatenating files. An attempt will be made to read a time value from
the title string in each frame, which should be preceded by
'<TT>t=</TT>', as in the sample below.</p>

<p>A sample piece is included below:
<pre>
MD of 2 waters, t= 0.0
    6
    1WATER  OW1    1   0.126   1.624   1.679  0.1227 -0.0580  0.0434
    1WATER  HW2    2   0.190   1.661   1.747  0.8085  0.3191 -0.7791
    1WATER  HW3    3   0.177   1.568   1.613 -0.9045 -2.6469  1.3180
    2WATER  OW1    4   1.275   0.053   0.622  0.2519  0.3140 -0.1734
    2WATER  HW2    5   1.337   0.002   0.680 -1.0641 -1.1349  0.0257
    2WATER  HW3    6   1.326   0.120   0.568  1.9427 -0.8216 -0.0244
   1.82060   1.82060   1.82060
</pre>

Lines contain the following information (top to bottom):
<ul>
<li>title string (free format string, optional time in ps after '<TT>t=</TT>')
<li>number of atoms (free format integer)
<li>one line for each atom (fixed format, see below)
<li>box vectors (free format, space separated reals), values: v1(x) v2(y) v3(z) v1(y) v1(z) v2(x) v2(z) v3(x) v3(y),
the last 6 values may be omitted (they will be set to zero).
Gromacs only supports boxes with v1(y)=v1(z)=v2(z)=0.

 
</ul>

This format is fixed, ie. all columns are in a fixed
position. Optionally (for now only yet with trjconv) you can write gro
files with any number of decimal places, the format will then be
<tt>n+5</tt> positions with <tt>n</tt> decimal places (<tt>n+1</tt>
for velocities) in stead of <tt>8</tt> with <tt>3</tt> (with
<tt>4</tt> for velocities). Upon reading, the precision will be
inferred from the distance between the decimal points (which will be
<tt>n+5</tt>). Columns contain the following information (from left to
right):

<ul>
<li>residue number (5 positions, integer)
<li>residue name (5 characters)
<li>atom name (5 characters)
<li>atom number (5 positions, integer)
<li>position (in nm, x y z in 3 columns, each 8 positions with 3
decimal places)
<li>velocity (in nm/ps (or km/s), x y z in 3 columns, each 8 positions with 4 
decimal places)
</ul>

Note that separate molecules or ions (e.g. water or Cl-) are regarded
as residues.  If you want to write such a file in your own program
without using the GROMACS libraries you can use the following formats:

<dl>
<dt>C format 
<dd><tt>"%5d%5s%5s%5d%8.3f%8.3f%8.3f%8.4f%8.4f%8.4f"</tt>
<dt>Fortran format 
<dd><tt>(i5,2a5,i5,3f8.3,3f8.4)</tt>
<dt>Pascal format
<dd>This is left as an exercise for the user
</dl>
Note that this is the format for writing, as in the above example
fields may be written without spaces, and therefore can not be read
with the same format statement in C.
<hr>
<div ALIGN=RIGHT>
<font size="-1"><a href="http://www.gromacs.org">http://www.gromacs.org</a></font><br>

</div>
</body>
